<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../../javascript/plug-ins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../../css/style.css" />
    <script src="../../javascript/jquery.js"></script>
    <script type="text/javascript" src="../../javascript/plug-ins/layui/layui.js"></script>

    <script src="../../js/zyrpublic.js?v=121"></script>
    <script src="../../js/zyrfunction.js?v=113"></script>
    <script type="text/javascript" src="js/AddCoupon.js?v=1.4"></script>
</head>
<body>
<div class="page-wrap">
    <section class="page-hd t">
        <header>
            <h5 class="title">
                <a href="#" class="red">优惠券设置</a>
            </h5>
        </header>
        <hr>
    </section>


    <div class="panel panel-default">

        <div class="form-content">

            <form>
                <div class="form-group-col-2">
                    <div class="form-label">类型：</div>
                    <select id="types" class="width40">
                        <option value="0">请选择</option>
                        <option value="21">新人优惠券</option>
                        <option value="22">普通优惠券</option>
                    </select>

                </div>
                <div class="form-group-col-2">
                    <div class="form-label">优惠券名称:</div>
                    <div class="form-cont">
                        <input type="text" class="form-control float_left form-boxed width50" id="name" placeholder="请输入优惠券名称" />
                    </div>
                </div>

                <div class="form-group-col-2">
                    <div class="form-label">优惠券面值:</div>
                    <div class="form-cont">
                        <input type="number" step="1" class="form-control float_left form-boxed width50" id="val" placeholder="请输入优惠券面值" />
                    </div>
                </div>

                <div class="form-group-col-2">
                    <div class="form-label">需要金币数量:</div>
                    <div class="form-cont">
                        <input type="number" step="1" class="form-control float_left form-boxed width50" id="GlodNum" value="0" step="1" placeholder="请输入需要金币数量" />
                    </div>
                </div>

                <div class="form-group-col-2">
                    <div class="form-label">最少满足金额:</div>
                    <div class="form-cont">
                        <input type="number" class="form-control float_left form-boxed width50" id="MoreMoney" value="0" step="0.01"  placeholder="请输入最少满足金额" />
                    </div>
                </div>

                <div class="form-group-col-2">
                    <div class="form-label">内容:</div>
                    <div class="form-cont">
                        <textarea type="text" class="form-control float_left form-boxed width50" id="Concent" placeholder="请输入优惠券内容" ></textarea>
                    </div>
                </div>

<!--                <div class="form-group-col-2">-->
<!--                    <div class="form-label">优惠券图片:</div>-->
<!--                    <div class="form-cont">-->
<!--                        <input type="text" class="form-control float_left form-boxed width50" id="share_url" placeholder="优惠券图片" />-->
<!--                        <div class="width10 text-center float_left border_gray"><img src="../../img/nopic.png" id="img_info" height="31px"/></div>-->
<!--                        <form style="display:none" action="" method="post" enctype="multipart/form-data">-->
<!--                            　　<input type="file" style="display:none" name="file" class="image1" id="image1" value="">-->
<!--                        </form>-->
<!--                        <input type="button" onclick="getElementById('image1').click();" class="btn img_serch" value="请选择图片" />-->
<!--                    </div>-->
<!--                </div>-->

                <div class="form-group-col-2">
                    <div class="form-label">起止时间：</div>
                    <div class="form-cont width50">
                        <input type="text" id="times" class="form-control width70" placeholder=" 时间起始-时间结束 ">
                    </div>
                </div>

<!--                <div class="form-group-col-2">-->
<!--                    <div class="form-label">是否启用：</div>-->
<!--                    <div class="form-cont" id="sex">-->
<!--                        <label class="radio">-->
<!--                            <input type="radio" value="1" checked="checked" name="mm" /><span>启用</span>-->
<!--                        </label>-->
<!--                        <label class="radio">-->
<!--                            <input type="radio" value="2" name="mm" /><span>禁用</span>-->
<!--                        </label>-->
<!--                    </div>-->
<!--                </div>-->

                <div class="form-group-col-2">
                    <div class="form-label">优惠券有效天数:</div>
                    <div class="form-cont">
                        <input type="number" id="CardDay" value="0" step="1" placeholder="请输入天数" />天
                    </div>
                </div>


                <div class="form-group-col-2">
                    <div class="form-label">数量:</div>
                    <div class="form-cont">
                        <input type="number" id="CardNum" value="0" step="1" placeholder="请输入数量" />
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">每人限领数量:</div>
                    <div class="form-cont">
                        <input type="number" id="onlynum" value="1" step="1" placeholder="请输入每人限领数量" />
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">是否显示小程序:</div>
                    <div class="form-cont">
                        <div class="form-cont isdispaly" style="margin-left: 0px">
                            <label class="radio">
                                <input type="radio" value="0" checked="checked" name="isdispaly"/><span>显示</span>
                            </label>
                            <label class="radio">
                                <input type="radio" value="1" name="isdispaly"/><span>不显示</span>
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label"></div>
                    <div class="form-cont">
                        <input type="button" value="提交" onclick="SubmitInfo()" class="btn btn-info" />
                        <input type="button" value="返回" onclick="re()" class="btn btn-info" />
                    </div>
                </div>


            </form>

        </div><!---form-content---->

    </div><!---panel--->

</div><!---page-wrap------>


<!--<div class="mask"></div>
<div class="dialog">
<div class="dialog-hd">
    <strong class="lt-title">本地图片</strong>
    <a class="rt-operate icon-remove JclosePanel" title="关闭"></a>
</div>
<div class="dialog-bd" style="height: 500px;overflow: scroll;">
    <form style="display:none" action="" method="post" enctype="multipart/form-data">
    　　<input type="file" name="file" class="image1" id="image1" value="">
    </form>
    <div class="flex flex-wrap margin_buttom10">
        <input type="button" onclick="getElementById('image1').click();" value="上传图片" class="btn btn-info margin_left10" />
    </div>

    <div class="flex flex-wrap flex-col-5" >
        <div class="box-child">
             <div class="img_box">
                <img width="100%" height="170px" src="../../../img/invitation.png"/>
                <div class="img_title text-center">好看的图片.png</div>
             </div>
        </div>



    </div>


</div>
<div class="dialog-ft">
    <button class="btn btn-info JyesBtn">确认</button>
    <button class="btn btn-secondary JnoBtn">关闭</button>
</div>-->



</div>


</body>
<script>
    $('[name="file"]').change(function(){
        var files = $("#image1").get(0).files;
        var data = new FormData();
        data.append('file', files[0]);
        var MyTest = document.getElementById("image1").files[0];
        var reader = new FileReader();
        reader.readAsDataURL(MyTest);
        reader.onload = function(theFile) {
            var image = new Image();
            image.src = theFile.target.result;
            image.onload = function() {
                $.ajax({
                    type:"POST",
                    url : "../../../../../UploadServlet?serialtype=img_active",
                    data: data,
                    cache: false,
                    dataType : "json",
                    processData: false,
                    contentType: false,
                    success : function(datas, file, result) {
                        $("#share_url").val(datas.data[0].src);
                        $("#img_info").attr("src","/img_active/"+datas.data[0].src);
                    },error:function(){
                        alert("==error==");
                    }
                });
            }
        }
    });

</script>
<script>

    $('.img_serch').click(function(){
        $(".mask").show();
        $(".dialog").show();

    });

</script>

</html>
